import java.util.*;
public class arraylist_methods {
    public static void main(String[] args)
    {   ArrayList<Integer> l1=new ArrayList<>();
        ArrayList<Integer> l=new ArrayList<>(); 
       /// System.out.println(l.size());
        l.add(1);
        l.add(2);
        l.add(3);
        l1.add(2);
        //Collections.copy(l, l1);  //l copy to l1
        System.out.println(l);
        


        //Collections.shuffle(l);
        //System.out.println(l);

        //Collections.reverse(l);
        //System.out.println(l);
       
        List<Integer> sublist = l.subList(0,2);
       // System.out.println(sublist);

        
        l1.stream().forEach(ele->System.out.println(ele)); //using lambda function
        System.out.println("-------------");

        Iterator<Integer> it = l1.iterator();


    }
}
